package pdm.traj.entity;

import java.io.IOException;

import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;

public class Station {
	private String lacid;
	private String cellid;
	private double lng;
	private double lat;
	
	public Station(String lacid, String cellid, double lng, double lat) {
		this.lacid = lacid;
		this.cellid = cellid;
		this.lng = lng;
		this.lat = lat;
	}
	
	@Override
	public String toString() {
		ObjectMapper om = new ObjectMapper();
		String str = "noval";
		try {
			str = om.writeValueAsString(this);
		} catch (JsonGenerationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (JsonMappingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return str;
	}
	
	public String getSid() {
		return lacid + "_" + cellid;
	}
	
	public String getLacid() {
		return lacid;
	}
	public void setLacid(String lacid) {
		this.lacid = lacid;
	}
	public String getCellid() {
		return cellid;
	}
	public void setCellid(String cellid) {
		this.cellid = cellid;
	}
	public double getLng() {
		return lng;
	}
	public void setLng(double lng) {
		this.lng = lng;
	}
	public double getLat() {
		return lat;
	}
	public void setLat(double lat) {
		this.lat = lat;
	}
}
